<?php
/**
 *
 * User: JSparrow
 * DateTime: 2016/11/24 16:43
 * Created by PhpStorm.
 */

namespace app\modules\admin\controllers;

use app\modules\admin\models\form\CategoryForm;
use yii\web\Controller;

class CategoryController extends Controller
{

    public function actionIndex() {
        return $this->render('index');
    }

    public function actionCreate() {
        $category = new CategoryForm();
        $category->setScenario(CategoryForm::SCENARIO_CREATE);
        if($category->load(\Yii::$app->request->post()) && $category->create()) {

        }

        return $this->render('create', ['model' => $category]);
    }

}